package com.zhl.service_.impl;

import com.zhl.dao_.FunctionMapper;
import com.zhl.entity.Function;
import com.zhl.service_.FunctionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

/**
 * Created by Administrator on 2018/11/6.
 */
@Service
public class FunctionServiceImpl implements FunctionService {

    @Autowired
    private FunctionMapper functionMapper;

    @Override
    public int addFunction(Function function) {
        function.setFid(UUID.randomUUID().toString().replace("-",""));
        function.setPid("0");
        function.setGeneratemenu("1");
        return functionMapper.addFunction(function);
    }

    @Override
    public List<Function> functionList() {
        return functionMapper.functionList();
    }

    @Override
    public Function queryFunctionById(String id) {
        return functionMapper.queryFunctionById(id);
    }


    @Override
    public int deleteFunction(String id) {
        return functionMapper.deleteFunction(id);
    }

    @Override
    public int updateFunction(Function function) {
        return functionMapper.updateFunction(function);
    }
}
